/*******************************************************************************
 * Copyright (c) 2010, 2030 www.itlaobing.cn
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *******************************************************************************/
package cn.itlaobing.service;

import java.sql.SQLException;
import java.util.List;

import cn.itlaobing.dao.OrderDao;
import cn.itlaobing.exception.MyBusinessException;
import cn.itlaobing.model.OrderModel;

/** 
 * ClassName: OrderService <br/> 
 * Function: TODO 功能描述 <br/> 
 * date: 2017年11月1日 下午2:56:08 <br/> 
 * 
 * @author lhb 
 * @version  
 * @since JDK 1.8 
 */
public class OrderService {
	private OrderDao od=new OrderDao();
	//支付
	public int zhifu(String count)throws MyBusinessException{
		int r=0;
		try {
			r=od.zhifu(count);
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
			throw new MyBusinessException(e.getMessage());
		} catch (SQLException e) {
			e.printStackTrace();
			throw new MyBusinessException(e.getMessage());
		}
		return r;
	}
	//查询
	public List findAll(int id)throws MyBusinessException {
		List list=null;
		try {
			list=od.findAll(id);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return list;
	}
    //取消订单
    public void quxiao(String count) throws MyBusinessException{
        try {
            od.quxiao(count);
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
            throw new MyBusinessException(e.getMessage());
        } catch (SQLException e) {
            e.printStackTrace();
            throw new MyBusinessException(e.getMessage());
        }
    }
    //删除订单
    public void del(String count) throws MyBusinessException{
        try {
            od.del(count);
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
            throw new MyBusinessException(e.getMessage());
        } catch (SQLException e) {
            e.printStackTrace();
            throw new MyBusinessException(e.getMessage());
        }
    }
}
